refactor the server project