Move the callback-stytle code into its own file