Minor fixes
Refactor