restructuring to support rustpkg