refactoring server to be multiuser