refactor video sample