refactoring of view; fix for longest prefix search