Move configuration logic into its own module