break io out into a separate file