complete refactoring of v2.0, very much a work in progress