refactored link creation