Refactored detection package to ahocorasick