If the handlers can be static, then it might make sense to turn this into a map lookup.