Minor refactoring & style cleanup