refactor, add client