Refactor the whole architecture and all tests pass.