could this be made a bit more succinct by casing on both `maybe_bucket_type_exists` and `S`, at once:

```erlang
case {maybe_bucket_type_exists(Type), S} of
    {true, true} ->
        ...;
    _ ->
        ...
end
```