factored code into edit_types.hpp and edit_alignment.hpp