Completed next round of refactoring.