Justins fixes, moving configuration away from scary function scope.