refactoring server messages (DRY violations)