Refactored the link manager.