cleaned up some javascript templates