make use of the type switch that im already using