clean up code consistency
Merge pull request #2008 from agchou/clean-up-code

some code clean up