Convert conditions and order to lambda