more optimization changes