refactor link gen
updated