I feel like the code would be easier to understand if this block was a method...