change to case insensitive and optimize highlight logic