refactor views into class base view