Added DAO layer
Refactored code
Perfomance optimizations