Refactored the Client class into a couple of helper classes.