Combined the handler method for insert+upsert