Improve object collapsing