remove unnecessary inreplace