Use simple if statement instead of switching on type