Refactors to a directive and add a-tag dynamically