Refactored JsTrans.php to increase code readability.