in process of abstracting dao out and the test for it