refactor the configureSentry method