makesymlinks.sh refactoring