Fix variable pipelining and promote variable re-use