module: cleanup _initPaths function

Simplified some codes