refactor and test markup.links