list/target refactor

This follows up #2532 and #2392 abstracting out some duplicated
code.  Still not perfect, but better.