refine some DB API