refactor RBE into a cleaner structure