An experimental refactoring of the RECAP extension.