Simplify state return value
!foo.nil? => foo
Replace an .each with .find
Unpack triple instead of indexing into it
Eliminate redundant line
Make assignment easier to see
Merge pull request #2 from zachallaun/master

Code review and suggested changes!