Separate server code into its own module