Refactoring code (Removing warnings in Translate method)