pulled v2 stuff into its own package, added header extraction