ladder balancing is moved into a separate class