modify DB handling

not fully finalized yet