Refactor with DB and Dao objects