Note that this snippet now looks very similar to what we have in toggleLayer() function, except that here we don^t have (and need) the `else` statement. I think it still makes sense to seperate these 2 concerns.