locale and language detection moved to separate class