Refactor Server class