refactor to use a DAO