improve link parsing