Refactor to work with RoI