refactor views and add tests for pagination and delete links