Refactored BarrelScript (second pass)