improved code readability

using forM_ instead of code repetition
Merge pull request #44 from konradvoelkel/patch-4

improved code readability