added path normalization, refactorings