refactor view tests