refactor unit test and removed language detection