refactor redir_do into smaller methods