Optimize blockStateToString, remove closeQuietly