Simplify log inreplace and remove comments