Refactoring join engine.