UNTESTED dbstruct rewrite done