refactoring Ladder.cs