split out function to retrieve longname