simplified a bit more and fixed some broken tests