Moving setVersion logic into foundry