simplify input and output reassignments processing

The idea is to reduce duplication of code for input / output reassignments handling by getting rid of 'targets' in those parts of code.