added RMI and minor improvements