maybe its better to now move this code into the switch statements even if it then means repeating it multiple times