A software developer writing the search algorithm shown in Figure 1 decided to reorganise the code by creating it as a subroutine. Line 1 and Line 2 were removed, and both the array data and the variable target were redefined as parameters of the subroutine.
Figure 1
1 data ← [45, 12, 78, 34, 89]
2 target ← 78
3 found ← false
4 i ← 0
5 WHILE i < 5 AND found = false
6 IF data[i] = target THEN
7 found ← true
8 ELSE
9 i ← i + 1
10 ENDIF
11 ENDWHILE
State two reasons why the developer decided to write this search algorithm as a subroutine.