Imploding repeated functions into common base class
Moving db calls to db singleton