Working on refactoring Server