updated controllerclientcpp; refactored code