refactoring with hlint.