Refactor preventLink feature