symlink handling refactoring