Split the replace functions

Split the replace functions for when we have a product id