fix output redirections printed by --dry command
minor refactoring
Merge pull request #917 from osa1/dry-output

#913 reopened for master branch