Made DB operations general