cleaned up some IO