Move all application code to static callbacks