refactors Ordering for searches