More refactoring to split anchor tag generation into separate methods.