refined some parts in linking