made links conversion more generic