Minor refactoring / reorganization