removed duplicate code in Path