refine dbstruct handling