Refactored code
Created three new classes. DB, Models
Added getters/setters in class