Move some generalization code out to separate parts