- Extracted the write to file procedure in an extra class