refactoring and adding links