Refactor QuanSequence tree edit