replace per-line edit btn with top-level add existing btn and also
refactor and rename variables