Support mingw48

Refactor