refactor of video device