Revert "Revert "Remove needless "end"""

This reverts commit ca7a63d15aaeea796d800441dffaba0dbc070a4a.