moved js file to handle it like a template