fixed test factory, added more tests