fix DSRGIFG and clean it up