remove duplicate code in pl-tts