A bit of code cleanup
Following upstream