Refactor dispatcher builder.