Implemented all the callbacks.