improve spec db handle