Why not move this code over to the js file?