Use hash.each_key instead of hash.keys.each

each_key is faster than keys.each