finish factoring out the data access layer