refactored the core of testing client to a separate base class