optimize theme initialization