better replace code