refactoring insert