Added replaceWith method for inline editing