refactored db class to use a seperate settings class