Abstract out database references