Encasing in a single block and pulling out a upstream variable