refactor configuration so that specifying klass is overridable