parse PI's target and data, fixes #4