Cleanup and updated db structure

Signed-off-by: Ravn T-M <ravn.tm@gmail.com>