start of the 3.8.0 refactor, wrote more tests as well