Revert "Revert some commits"

This reverts commit 222447eaa19fd0b9b442570b9bc23f4864aa9796.