refactor var