Refactoring - Javascript

Language: