optimized method