Refactor to use EitherT