This reverts commit 12a413bf02 as it needs some more changes due some changes that were merged into 4.1 before.
12a413bf02