light refactoring and cleanup.