Revert some of the changes made in commit 3210db1f3a29f8412091b237acff30140ed68e03