Reduce scope of variables