refactored video player