refactored db stuff into its own class
Merge branch 'seperationOfConcern'

Refactored DB stuff into its own class