documentation and clean up of rbms