LPS-30514

The replace tokens seem a bit strange, but it's essentially trying to remove duplicates and I couldn't think of a better way to do it after reviewing it.