Make caret functions stateless