relocated reset_metadata and reset_spine to inside reset_state
some framework for ncx
Cleaning up some spacing and reordering methods