need to refactor this a bit to make room for data source tests