Some simple refactoring.