Refactor parser inito a struct and method