refactor dataaccess