daofactory,lots of refactoring