first stage of refactoring server side model