Refactor out sysconfig handling

I miss a complementary test checking that it respect the original comment if it's there