Better language-specific logic (JS, Perl)