improve composeinplace