refactored several tests and updated factories