Refactored translation functionality.