refactor validator translation in a listener