[WIP] rework database class