overhauled db structure