Revert "ENG-5540 changed file declaration inside collect function"

This reverts commit 989c9d9822ac33d412374c2c41f05b967a57dbca.
Revert "ENG-5540 Added some more print statements for Jenkins test failure"

This reverts commit 68047b3d8f6534542344a06e14b40efa4c8898a9.
Revert "ENG-5540 refactored method and variable names and changes some variable declarations"

This reverts commit 87bb7fad67e7b3e89744163ed878d8026c836046.
ENG-5540 Fixed Jenkins test failure