added new tests and fixed factories