removed unnecessary explicit var declaratins and adjusted affected code