refine code, remove unused code of dvr.