Add HasOrderedSubPatterns module to refactor the code
Cosmetic change