DAO pattern general implementation