centalize getcwd() usage for symlink directory