Swap usage of create_function for defined function as a callback