src: cleanup scoped variables

SQUASH Didn't like the way I was scoping the variables.