refactoring for linear search
renaming