refactor tables into view classes