Engine/Search Logic Refactor