How can i write these if statements as a single nested switch