Use a custom class to keep track of the variables