Move parser stuff to a separate file