Use shift instead of compare and simplify the extractors