A lot of refactoring to simplify having multiple implemntations. this does not build and/or run