cleaning up IOWrapper. Make all functions member of the class