Minor clean up

Nothing very major here in terms of performance, but I tried to
clean up some whitespace irregularities and make the code
more similar in each of the blocks.