More functional, idiomatic and monadic, less code