Small refactoring in preparation for refactoring model controller.