refactor insert test