Change WriteFile to Class