finished DB framework