Consistent formatting

The formatting in these two files was particularly inconsistent, with a
mix of tabs and spaces and irregular indenting. I basically ran it
through a program that auto-indented everything instead of doing it
manually, so there may be a few things that are off about it, but the
formatting is generally consistent now.
Extract common calls into a function

I actually think that a lot of this could be better handled by a data
structure that represents all of the lines and their associated data.
Right now we have to have these global variables and then remember about
each specific strategy. Instead, we should have a "strategies" object
that contains all of this information, and then do generic operations on
it.

I'll address this in the next commit :)