Refactoring and adding daos