Created a PileHelper class to move out code from Scene.