* outsource redirect operations in own function
* adapt tests to new doRedirect function