refactor(validation): remove recursion and add test cases for translator