Simplify insert code