Revert "Revert "Call end stage at the parent node and divide more""
Revert "Revert "Call end stage at the parent node and divide more""

This reverts commit fda13965dbeaad24ef5c0a57af9ea6bdbe6b0c93.

Mapotempo/optimizer-api,Mapotempo/optimizer-api,Mapotempo/optimizer-api,Mapotempo/optimizer-api