Collapsing a begin-end