New feature: refactor and cover views with tests.