Includes joint work with @abmclin, @pmatos, and @jessealama. original commit: 2649600c68ff57efb63d6d5d10c9d9f73368f59a