Update optimizations to be aware of code/message attributes on header steps.