Database improvements

Database improvements