Begin moving edit logic into JS