Made some progress in implementing server
Partially implemented refactoring