Restructured the whole module
Refactored code accordingly