refactor server classes