Refactoring of dao layer
Refactoring of dao layer and added tests