Rewrote similar patterns check