refactoring on the serverside