cleaning up code with HLint and -Wall