Refactor to have a DAO