backport changes up to b874cfe65ebbeb0d89305e766d7b62deac6cf3d0.

These changes reintroduce magic strings everywhere that are yet to be fixed