Should we have a catch for the KeyError, which might happen if someone calls this with a type that's not in the handlers dictionary? The code you are replacing seemed to have some check that the type was valid.

By the way, I do like the use of the dictionary here to determine which handler to use - nice!