don't generate new function object every tick