Code Refactoring

Added code in main class to iterate through the modules.

Signed-off-by: Siddharth Goel <siddharth98391@gmail.com>