Moved js to js file