Clean up write statements