Added support for path mapping
Refactored