Simplify the insert function