fixes a bug: use test factory in test classes