extending DB layer
some middelware and DB layer re-organization