revert the revert along with fixes to make it pass e2e tests.