refactored to make it easier to change the id->dir mapping
refactoring get path for study id