Various techniques for patterning a substrate are disclosed. Specifically, implantation of the first species into an anti-reflective coating layer is contemplated to reduce stress in the layer that may be generated during the exposure stage or development stage. During these steps, the resist layer or the resist structure may under mechanical changes (e.g. shrinkage) while it is in contact with the anti-reflective layer. Such changes may introduce stress in the anti-reflective layer, which may contribute to excessive line edge roughness (LER) or line width roughness (LWR). By implanting the first species before, during, or after these steps, the stress in the anti-reflective layer may be avoided or compensated, and excessive LER or LWR may be avoided or reduced.