This whole else block can be replaced with `handleInsertAt` since it has the same functionality and also checks for null view.