v2 refactors and some tests