update code based on golint.