Code cleanup in rmt