Complete refactoring, unfinished
Finish refactoring, basic testing infrastructure in place