Refactored code translation