Lots of refactoring. Changed "client" to Client