use patterns that are more exact to avoid replacing the same value twice