Cleaned up some js in templates