Moving JS block to set precedence