Moved types and database initialize to the set database function