Line Follower: can my code be optimized?

Especially prevalent when the motor makes a sudden change in direction.