Refactor settings and clean views
Fix tests
Rework templates