Refactoring attempt.