Refactor for new architecture.