Refactor some code for Camera and VideoFile