DNN-5733 - refactored the code to retrieve the versioned modules