Minor refactoring / code cleanup.