Replace kernel scanning function with more usable implementation.