Tweak NewClient to improve testability