replace callIfSome by foreach