Use function literature instead of lambda functions for pickling