refactor the code about load_fact into hive