Rearranging foundry for testing