Updated the alloy generation to support the hierarchy