It was hard to understand that the nested `if` could actually be `elsif`, and the indentation was a bit broken.