refactor server side code, add unit test.