New hash syntax. Proper RSpec syntax. Refactored code out into seperate methods.
Added missing line end.
Merge pull request #2 from kaspernj/kj/code_quality_improvements

Code quality improvements