Pulled all of the blocks out into local variables. For cleanliness and sanity.