You can also use a high-level when-clause at the top to handle all of the below cases.