insert item refactor