refactoring character factory