views API and structure refactoring