Refactoring to an array

Refactor code that uses a list of variables, to a single variable whose value is a list.