[R] Moved Custom to MainF7, code cleanup