modify and optimize the code of db stucture nad operate_funcs