Refactoring server side code.