Switch on type is considered bad practice