Refactoring from suggestions by golint