Clean up the shim build code. Specifically the ensure and regeneration of metadata
Clean up the shim build code. Specifically the ensure and regeneration of metadata