switching to criteria system and fixing the tests.