Shifted JavaScript logic from the head to external file, is currently WAI