remove reliance on FILE *