Implementation of callback functions.