Extracting strings to constants and improving equals