Code cleanup
Writer improvement another step