Cleaning up code, refactoring daos