remove a redundant guard in link'
minor refactoring