refactor view as a new class
add new index and view tests
cr comments