return generated functions and provide proper contexts for off fns