refactor lab1