Fix up some poorly written React code