Refactor to make both go vet and Go 1 happy