Moving grok into functions.