refactor out clientmodel.getAgent()