refactor link creation