More optimizations
Write out to devices in background thread
Create factories once at  start
Revert