cleaned up editcontroller