refactoring and add views