Optimize RUN statements and add tags