refactor callback chain

This will also make it easier to change the symlink loop limit.