Reorder db initialization