I suggest integrating AGTree into this repo. We can replace the current filter utilities with the AGTree and compile the hostlist based on the AST. Reference: https://www.npmjs.com/package/@adguard/agtree