Moved some shared utilities to a baseclient class