refactor client model