Reduce the complexity in `#end`