Factor out move-lines