unified insert function, v1