move db creation from bin to index