Some refactoring based on github PR diff.

Remove unnecessary refactoring of code that happened
unintentionally.