refactoring according to new dao with transactions