renamed replace_content method