Merge insert function and add insert view page