Separate JavaScript code