Simplify `getHeadersOrBlocks` function
Simplify `getHeadersOrBlocks` function

Previously we had a nested `do` block, nested let statements. We can
simplify this and factor everything out into the top level `do` block.

clample/lambdabtc,clample/lambdabtc,clample/lamdabtc,clample/lamdabtc