Reverting some changes from commit 00a6cff357340a8cc8f21a4888b88777a5a524a3