Refactoring and fixing views