implement a IOHandler instead of static functions