Refactor handler invocation according to the "tell don't ask principle".