refactor vars