HIVE-8852: refactor again