making improvements suggested by Preethi

this is valid for 2.4 and 2.5.0 but not 2.5.1+, just fyi when merging