resources freed
more beautiful code