Refactor Server class.