Refactored base client code into external file.