* Some light refactoring and cleanup.