move logic to set_configuration method