consolidate edit and insert for page