Chaning factoryClass to factory-class and minor refactoring.