This partially reverts commit 8ecaf5f9. (cherry picked from commit 6b0b2569) (cherry picked from commit 85e62204) (cherry picked from commit fbfb0019) (cherry picked from commit e4cd7f59)