Refactor the way scripts are included in header.