Updated to allow global replacement