RC: More refactoring and cleanup