Refactors server.