restructure IO libs a bit