edit lecture: refactoring