link shape refactor