Re-order JS call order