Extract WriteCompletiobHandler as inner class and review flushQueue
Keep a single test
Add a duration trace