pushing out db handling into a separate class