Basically redo a8f6808928eb5aa63d6b07738b789489e1898794