Implement flexible target specification

See commit message.
That still requires `null` for the fields which shouldn't need to be specified?