Small refactors
Merge pull request #457 from anserran/smallrefactors

Small refactors