lots of io in here... but i realize it may be very difficult or impossible to refactor all of that and maintain the same interface for users effectively