[IMP] models: improve code of _convert_to_write(), make it easier to read