improving db commands