less hardcoding; tolerate extra whitespace; more languages