use faster replace method