created a private function to parse flow input