Refactor video player