Use #all? instead of #detect
Use functional style to convert the array into hash
Minor changes to improve readability
Merge pull request #2 from rafaelpc/master

Minor improvements