refactoring Dao.js