Performance tweaks on additem and edititem