splitting link getting and markup processing into two methods