Refactoring work in progress.