more optimization in code