Refactoring parameter resolution
Moving variable into for loop