refactor factories and update specs