views refactor, test fixes