Code cleanups
Merge pull request #1 from ares/pr/822

Few code cleanups