Tidied method to retrieve codenames.