refactored qedit to make writing extensions easier