refactored factories and a few more tests