separated functions for (un)pickling an instance method into their own module