Partly reworked DB-layer.