More replace logic