Minor refactoring to prepare for the new console adapter.