Dummines refactoring and bug fixed