HIVE-8834: clean up
HIVE-8834: more refactor