Refactored code, added support of EnvVar in file path