use rules instead of tokens