optimize rmi implementations.