Refactor User and BlogPost creation using a factory class in tests