refactored to convert input tags and script to special characters