P3: This seems ripe for refactoring.