Lots of refactoring, strip out dependencies.