Refactored the server and renderer