refactors and integrates View class