Refactor. Remove rdoc and ri as it is never used.