refactor clients