Cleaned up to use the same pattern of string finding