add theme support and improve text filtering performance