before doing general optimization