HIVE-7624: refactor