adds support for multiple targets and switching between them