opemization some codes