More refactoring of views API