More functional, idiomatic and monadic, less code
Merge pull request #79 from nurkiewicz/patch-1

More functional, idiomatic and monadic, less code