Changed the way callbacks are handled