fixes around target being array or object, promise simplification