[Minor] Add comments and minor code cleanup for previous commit.

Remove console.log, commented statements, extra spaces, etc.