started refactoring the entire server structure