refactored video functional