Fix variable refactoring