refactored serverside model