Removing unnecessary closing code