refactoring and updating DMVID reg logic