Rewrite Database initialization