Refactoring dominion code.