Refactoring views and tests