Using hashmap for unit factor conversion