Refactoring into multiple script tags