move logic for getting config options to a class