minor refactor of replacement normalization code