RBT/general code clean-up