refactoring string checking 'if there is script tag'