more work on main removal function in gpkg