Eliminate a bit of legacy code
Rearrange variables