Remove unnecessary file open commands