Repeated code replaced by methods (ServerTests)