Minor rearrangement in <script>