[ticket/416] Reduce duplicated code in modules manager

B3P-416