Moved callbacks from 'this' to function parameters