minor improvements to datasource, refactored the test cases to use mock objects