Put the hooks for the main logic