TW: Increased scope of client var to allow for extension.