Removing unnecessary replace logic