Pull constants out of loops
Minor cleanup