optimalizations in RPI