minor performance improvement from sonar analysis
close stream