Simplify parsePaths function