Use existential operator instead of nested ifs