Move the registration of callback functions to special functions