Remove unnecessary expansion steps