added MVC pattern and created DB wrapper