refactored classifierfactory