#18 refactoring with hlint: not finished yet