clean up of database.c