factor out target (lots of breaking changes!)