Refactored video resource code for brevity