Incorporate hlint suggestions

hlint offers several suggestions to make the code more idiomatic.