refactor i/o interfaces (started)