Improve removeClosingTagAtEndOfString method
Variable renaming