It could. But 2 reasons.
1. I wanted to make sure that the code path accessed through the finalize is cheap (just a queue insert with RDD ID) and independent of any other code paths.
2. In future we may have other cleanups associated with RDD. Then they would be added to doCleanRDD() rather than here. This code path of cleanRDD stays unaffected.