Clean up variable declaration, more let, less top-of-proc var.