Refactoring and introducing link factory