SI-6605: extract TagKeys and other cleanup.