Refactor DAO