Refactor iohandler interface and fix a null pointer error.