Make parameter final
Make parameters final
Make code nicer
Use child number instead of left/right
Revert hunk from "Make code nicer"

This reverts a hunk from commit 02ca637.
Avoid unnecessary casting