Refactor the server example.