Given that all the if's do immediate returns, we can move this work to be after the key.contains("@") check.