begin client refactor