refactored link parsing rule