Standard module path logic and removed some unnecessary code duplications.