several ril changes and cleanup