small refactoring in server part