refactoring for labs