Reduced dumb code and handle generics in configfactory instance