refactoring. BUG when writting, adapter is writen twice ???