Extracted replace_comments and replace_tags