Optimize when no onCallbacks given
Remove unneeded closure variable
Remove unneeded function names