change config to class-based