Using substitution instead of sed