reduced scope of some variables