[REV] attempt to revert incorrect removals in f4d78ae738e474abd4e77dc8fc6cdf8a668a5d72
[FIX] bunch of changes lost in incorrect merge f4d78ae738e474abd4e77dc8fc6cdf8a668a5d72