make type a parameter of the ResultFileContext constructor and remove the type method.