Please guide me as to how to obtain the below bound and whether it is optimal.
Let a squarefree integer $N=\prod_{1 \leq i \leq m} p_i$ be a product of $m$ primes ($p_1 < p_2 < \dots < p_m$) and for any positive divisor $r$ of $N$, we denote $\frac{N}{r}=q_1q_2\dots q_s$ ($q_1<q_2,\dots q_s$) and let $\nu(N)$ be the number of distinct prime divisors of $N$. For $r$ as above, let $s=s(r):=\nu(N/r)$. Also, let $d(n)$ denote the number of divisors of $n$.
I am trying to estimate the sum $S=\displaystyle\sum_{\substack{1 < r < N \\ r|N}} \frac{2^{\nu(N/r)}}{(q_1+1)(q_2+1)\dots(q_s+1)}$ and would like to know if the bound is correct and also if it is optimal. Using the estimate $2^{\nu(n)} \leq d(n)$, I get \begin{align*} S &\leq \displaystyle\sum_{\substack{1 < r < N \\ r|N}} \frac{d(N/r)}{N/r} \leq \displaystyle\sum_{\substack{1 < r < N \\ r|N}} \frac{d(r)}{r} \end{align*} Now since $p_1$ and $\frac{N}{p_1}$ is the smallest and largest choice for r, a proper divisor of $N$, I write \begin{align*} S &\leq \displaystyle\sum_{\substack{p_1 \leq r \leq \frac{N}{p_1} \\ r|N}} \frac{d(r)}{r} = \displaystyle\sum_{\substack{ r_1 \in \mathbb{Q}, 1 \leq r_1 < \frac{N}{(p_1)^2} \\ p_1r_1 \in \mathbb{N},p_1r_1|N}}\frac{d(p_1r_1)}{p_1r_1}. \end{align*}
Now, I would like to take $\frac{d(p_1)}{p_1}$ outside but as $r_1$ need no longer be in $\mathbb{N}$, am I allowed? If allowing is justifiable, then, using the estimate $\sum_{n \leq N} \frac{d(n)}{n} \ll (\log^2 N)$, I get $S \ll_{\epsilon} \frac{d(p_1)}{p_1}(\frac{N}{p_1})^{\epsilon}$.
However, I am interested in knowing better bounds for this involving only $N$. Is there another way to crack this and get a better bound? And what would be an optimal bound? Can I get $\prod_i \frac{d(p_i)}{p_i}$ or anything in terms of $N$?