Minor refactoring and code cleanup
Merge