Code optimization and improving the performance

add Task