reduce scope of local variables