Refactor TWAClient to reduce duplicated code