refactored long if statement for link having relevant icon