# Handler Ordering In the past, message handlers used to be the only way to implement cross-cutting concerns like authentication, authorization, and certain kinds of validation. As those concerns needed to be applied before any other logic, it was necessary to run those handlers before all other message handlers. These message handler classes implemented `IHandleMessage` or `IHandleMessage` so that they would handle all incoming messages. > [!WARNING] > It is now recommended to plug into the [message handling pipeline](/nservicebus/pipeline/index.md) to implement these cross-cutting concerns. If it is not possible to migrate this kind of functionality out of message handlers, the order in which they will be executed can be specified. > [!NOTE] > Consult the [data access guidelines](/nservicebus/handlers/accessing-data.md) when multiple handlers for the same message need to participate in the same transaction. #### Specifying one handler to run first ```cs endpointConfiguration.ExecuteTheseHandlersFirst(typeof(HandlerB)); ``` #### Specifying multiple handlers to run in order ```cs endpointConfiguration.ExecuteTheseHandlersFirst( typeof(HandlerB), typeof(HandlerA), typeof(HandlerC)); ``` The remaining handlers (i.e. ones not specified in the ordering) are executed in a non-deterministic order.