Minor fixes
Minor refactor