Began refactoring server into separate files