Take function objects instead of functions in register_function