building dao and repo