refactoring links parser