better origin parsing