Rea: split into subfunctions