factorize output handler code
add directory target type
drop dummy deviceid

According to the comment, this is not needed anymore
code factorisation
rename parameter, for class-neutral interface
add server target type
code factorisation