removing redundant code in version case statements