refactored to require less paramaters passed to server