Improved the io nterface and implementation.