Extract this somewhere else and do it right. I think we identified at least one other thing that should have per-type configuration.