Indentation seems off here: two `end`s on the same level