rework Attr database code