Moved startup code into its own file