Refactor code to be more readable.

Search functions can be globalised with parameters.
Searching for order/orders is identical logic, just different amount.