refactoring: moving business logic to server level