removed useless uses of file object