Implemented DB layer