1. A method performed by a device, comprising: receiving, by the device, a data unit; determining, by the device, whether a current state, associated with a deterministic finite automata (DFA) that includes a portion of states in a bitmap and a remaining portion of states in a DFA table, is a bitmap state or not; determining, by the device, whether a value corresponding to the data unit is greater than a threshold value, when it is determined that the current state is not a bitmap state; determining, by the device, whether the current state is insensitive, when it is determined that the value corresponding to the data unit is greater than the threshold value, where insensitive means that each next state is a same state for the current state; and selecting, by the device, a default state, as a next state for the current state, when it is determined that the current state is insensitive.