WIP Refactor ensemble building.