Make repligard cleanup more flexible