Refactored the link stroke code