Optimizing target strings