Refactor server side.