Move normalization code out of config