started creating generic db functions