Put symlink dereferencing loop into function for copy installation
Keep creation of local var consistent
definition on one line
initialization on another