So you're reading some code you want to change & you notice that some of the data it works on wasn't passed explicitly to the routine. How do you make the inputs clear?
Split the routine. The top part gathers the parameters and passes them explicitly to the second part.