optimize scope