else if ?  And then in else set `handler` to `type` ?