Video refactoring