Refactor server classes