Moved some code to rmplus_dev