remove database initialization section and flatten document structure