Cleanup link logic