Refactorisation to add theme choice