Unify Unit ReplacementDict creation code