Don't create a new function if a callback is not needed.