restructured dao, forgotten commit
fixed tests