Abstracted some of the callback functions.