Refactor var