rearranging internal structures, moving debug to its own repo
fix single line mode bug