Moved server specific code to its own file