Refactoring on server side