Move parsing into parser.py