First attempt at refactoring: not 16 pages anymore, but still 10!