extract common code of a Theme's name finding into a method