Impriving Database processes aspects

Improving some aspects in the Database layer.