move all config logic to a new class