MAGE-6275

Please see comments + commit messages for detailed information.