Refactor and add DataAdapter functionality