Replace keys.each with each_key