Lets keep all this parsing separate from the AiRoutine and do it in a helper file.