complete port of Java RulerNode