Reduce variables scopes

No functional changes