added phase02 tests; refactored models; fixed bugs