updated the format switching for gem