ajax inline edit refactor