#30 refactoring by -Wall and hlint