compact/expand improvement