re-order refs for closure to work