Move IO instance to top of file