Inline scripts handling refined