Avoiding unused variables. Refactoring code to make more sense.