applied HLint suggestions to codebase