Cleaning up the IR refactoring