Improving Javascript code organization.