unit tested and separated write index