refactoring get script path